import { createStore, combineReducers, applyMiddleware } from 'redux'

// 使action可以执行异步函数
import thunk from 'redux-thunk'

// 接入redux插件
import { composeWithDevTools } from 'redux-devtools-extension'

// 导入项目reducer
import { login } from './reducers/login'
import { user } from './reducers/user'
import { article } from './reducers/article'

// 合并reducer
const rootReducer = combineReducers({ login, user, article })
// 创建store
export const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)))
